package com.kaifamiao.abstracts;

import java.util.logging.Logger;

// 被 abstract 所修饰的类就是 抽象类( abstract class )
// 抽象类与具体类(concrete class)最大的区别在于:
// 抽象类不可以直接实例化，具体类可以直接实例化
public abstract class Animal {

    protected static final Logger logger = Logger.getAnonymousLogger();

    protected String name;

    public Animal() {
        super();
        logger.info( "执行Animal类的无参构造" );
    }

    public Animal(String name) {
        super();
        logger.info( "执行Animal类的有参构造" );
        this.name = name;
    }

    public void introduce(){
        logger.info( "我是" + name );
    }

    public static void main(String[] args) {
        Animal a = null;
        // 'Animal' is abstract; cannot be instantiated
        // a = new Animal( "小黄" ); // 抽象类不能直接实例化
    }

}
